# Pull base image.
FROM ubuntu:14.04

# Install.
RUN \
#163 src
  echo -n 'deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse\ndeb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse\ndeb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse\n' > /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y build-essential openssh-server openssh-client && \
  apt-get install -y software-properties-common python-software-properties && \
  add-apt-repository ppa:chris-lea/node.js && apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y curl git htop man unzip vim wget && \
  curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - && \
  apt-get install -y nodejs && \
  echo "registry = https://registry.npm.taobao.org" > ~/.npmrc && \
  apt-get clean && \
  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 # mysql config
#add src
ADD src/ /usr/local/nginx/web/
ADD ./start.sh /start.sh
RUN chmod 755 /start.sh
# private expose
EXPOSE 3000
# volume for mysql database and wordpress install
CMD ["/bin/bash", "/start.sh"]
